<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Input</title>

  <style>
    * {
      padding: 0;
      margin: 0;
      box-sizing: border-box;
    }
    .ling-input {
      position: relative;
      margin: 1.5rem;
    }
    .ling-input-value {
      width: 100%;
      height: 3rem;
      line-height: 3rem;
      padding: 0 1rem;
      border: 1px solid #666;
      border-radius: 0.4rem;
    }
    .ling-input-value:focus {
      border: 1px solid red !important;
    }
    .ling-input-value:focus ~ .ling-input-label {
      padding: 0 0.4rem;
      color: red;
      top: 0;
      transform: scale(.75) translate3d(-1rem, -1em, 0);
      transition: all 150ms;
    }
    .ling-input-value::placeholder {
      color: transparent;
    }
    .ling-input-label {
      font-size: 1.2rem;
      position: absolute;
      top: 50%;
      left: 1rem;
      transform: translateY(-50%);
      color: #999;
      pointer-events: none;
      background: #fff;
    }
  </style>
</head>
<body>
  <div class="ling-input">
    <input class="ling-input-value" type="text" placeholder="账号" />
    <label class="ling-input-label">账号</label>
  </div>
</body>
</html>